export const statusStyle = {
  edit: {
    statusText: "搭建中",
    background: "#01C1B2",
  },
  audit_pass: {
    statusText: "审核通过",
    background: "#25BE13",
  },
  audit: {
    statusText: "审核中",
    background: "#FE702F",
  },
  online: {
    statusText: "已发布",
    background: "#FF6383",
  },
  audit_not_pass: {
    statusText: "审核失败",
    background: "#FF3000",
  },
  offline: {
    statusText: "已下架",
    background: "#DC63FF",
  },
};

export const contentSearchFormConfig = [
  [
    {
      name: "type",
      label: "内容类型",
      type: "select",
      options: [
        {
          label: "报告",
          value: "report",
        },
        {
          label: "消息",
          value: "message",
        },
      ],
    },
    {
      name: "category",
      label: "分类标签",
      type: "treeSelect",
      options: [],
    },
    {
      name: "status",
      label: "内容状态",
      type: "select",
      options: [
        {
          label: "搭建中",
          value: "edit",
        },
        {
          label: "审核中",
          value: "audit",
        },
        {
          label: "审核通过",
          value: "audit_pass",
        },
        {
          label: "审核不通过",
          value: "audit_not_pass",
        },
        {
          label: "审核撤销",
          value: "audit_cancel",
        },
        {
          label: "已发布",
          value: "online",
        },
        {
          label: "已下架",
          value: "offline",
        },
      ],
    },
  ],
];
// 操作项 分为两类 一类按钮 一类菜单项
export const actionGorup = {
  contentButton: [
    { code: "content_preview", label: "预览", disabled: false },
    { code: "content_build", label: "内容搭建", disabled: false },
    { code: "content_copy", label: "复制内容", disabled: false },
  ],
  contentMenu: [
    { code: "content_edit", label: "编辑", disabled: false },
    { code: "content_copy_link", label: "复制链接", disabled: false },
    { code: "content_submit", label: "提交审批", disabled: false },
    { code: "content_cancel", label: "撤销审批", disabled: false },
    { code: "content_publish", label: "发布", disabled: false },
    { code: "content_offline", label: "下架", disabled: false },
  ],
};
// 不同的状态下 功能禁用项
export const statusdisabledList = {
  edit: ["content_copy_link", "content_publish", "content_offline"],

  audit: [
    "content_build",
    "content_edit",
    "content_copy_link",
    "content_submit",
    "content_publish",
    "content_offline",
  ],

  audit_pass: [
    "content_build",
    "content_edit",
    "content_copy_link",
    "content_submit",
    "content_offline",
  ],

  audit_not_pass: [
    "content_copy_link",
    "content_submit",
    "content_publish",
    "content_offline",
  ],

  online: [
    "content_build",
    "content_edit",
    "content_submit",
    "content_publish",
    "content_offline",
  ],

  offline: [
    "content_copy_link",
    "content_build",
    "content_edit",
    "content_submit",
    "content_publish",
    "content_offline",
  ],
};

// 默认表单选项
export const DEFAULT_CONFIG = [
  {
    formItemName: "基础配置",
    formItemConfig: [
      {
        name: "内容标题",
        key: "name",
        placeholder: "请输入内容标题",
        message: "请输入内容标题",
        required: true,
        // editAble: false,
      },
      {
        name: "内容描述",
        key: "description",
        placeholder: "请输入内容描述",
        message: "请输入内容描述",
        required: true,
      },
      {
        name: "是否公开",
        key: "isPublic",
        uiType: "radio",
        required: true,
        enum: [
          { label: "是", value: "y" },
          { label: "否", value: "n" },
        ],
        defaultValue: true,
        // relyFn: (getFromValue) => {
        //   const triggerType = getFromValue("triggerType");
        //   return triggerType === "schedule";
        // },
      },
    ],
  },
  {
    formItemName: "模版配置",
    formItemCode: "templateConfig",
    formItemConfig: [
      {
        name: "选择模版",
        key: "templateType",
        uiType: "select",
        message: "请选择商家模版",
        required: true,
        enum: [
          { label: "商家报告", value: "group" },
          { label: "行业报告", value: "shop_group" },
          { label: "通用报告", value: "input" },
        ],
      },
      {
        name: "统计周期",
        key: "scheduleType",
        uiType: "radio",
        required: true,
        enum: [
          { radioComponent:"",label: "长期", value: "dateType" },
          { radioComponentPlaceHolder:"请选择月份",radioComponent: "MonthPicker", value: "dateRange",dateValue:"" },
        ],

        // relyFn: (getFromValue) => {
        //   const triggerType = getFromValue("triggerType");
        //   return triggerType === "schedule";
        // },
      },
    ],
  },
  {
    formItemName: "分享配置",
    formItemCode: "shareConfig",
    formItemConfig: [
      {
        name: "分享标题",
        key: "id",
        placeholder: "请输入分享标题",
        message: "请输入分享标题",
        required: false,
      },
      {
        name: "分享描述",
        key: "id",
        placeholder: "请输入分享描述",
        message: "请输入分享描述",
        required: false,
      },
      {
        name: "预览图地址",
        key: "id",
        placeholder: "请输入预览图地址",
        message: "请输入预览图地址",
        required: false,
        // editAble: false,
      },
      {
        name: "有效期",
        key: "scheduleType",
        uiType: "radio",
        required: true,
        enum: [{ label: "长期", value: true }],


        // relyFn: (getFromValue) => {
        //   const triggerType = getFromValue("triggerType");
        //   return triggerType === "schedule";
        // },
      },
    ],
  },
  {
    formItemName: "权限配置",
    formItemCode: "permissionConfig",
    formItemConfig: [
      {
        name: "登录可查看",
        key: "scheduleType",
        uiType: "radio",
        required: true,
        enum: [
          { label: "登录", value: true },
          { lable: "登录解锁更多", value: false },
        ],

        // relyFn: (getFromValue) => {
        //   const triggerType = getFromValue("triggerType");
        //   return triggerType === "schedule";
        // },
      },
      {
        name: "可见范围",
        key: "scheduleType",
        uiType: "radio",
        required: true,
        enum: [{ label: "登录", value: true }],

        // relyFn: (getFromValue) => {
        //   const triggerType = getFromValue("triggerType");
        //   return triggerType === "schedule";
        // },
      },
    ],
  },
];
